<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class Home extends MX_Controller 
{
	protected $lang;
	
	function __construct() 
	{
		parent::__construct();
		$this->load->model('home_model','home');
		$this->lang = get_languages();
		$this->home->initialise($this->lang);
	}
	
	public function index()
	{	
		$data['title'] = "Tin tổng hợp" ;
		$data['lg'] = $this->lang ;
		
		$data['list_cart']=$this->home->getProduct('product',10,0,1);
		$data['list_thiep']=$this->home->getProduct('product',10,0,7);
		$data['giaiphapnhanh']=$this->home->getProFromCat('product',22,10,0); //$table,$cat_id,$num,$offset
		$data['page'] = 'home/index' ;
		$this->load->view('layout/skin', $data);
	}
	
	public function category($catid=0)
	{
		$data['list'] = $this->home->getProFromCat('product',$catid,10,0);
		if($data['list'])
		{
			$this->load->view('home/category', $data);
		}
	}

}

?>